<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>问卷列表</title>
    <jsp:include page="../../../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <!-- 查询表单 -->
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">承租人</div>
                    <div class="field">
                        <div class="field">
                            <input type="text" id="cstNm" name="cstNm" class="ui-textbox" ligerui="width: 160"
                                   value="">
                        </div>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">合同号</div>
                    <div class="field">
                        <div class="field">
                            <input type="text" id="contNo" name="contNo" class="ui-textbox" ligerui="width: 160"
                                   value="">
                        </div>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">支付表号</div>
                    <div class="field">
                        <input type="text" id="paySchNo" name="paySchNo" class="ui-textbox" ligerui="width: 160"
                               value="">
                    </div>
                </div>

                <div class="clearFix"></div>
                <div class="btnsBox formBtns notRight">
                    <span id="searchBtn" class="sq-button-round" onclick="searchBtnEvent()">查询</span>
                    <span id="clearBtn" class="sq-button-round" onclick="clearBtnEvent()">清空</span>
                    <span id="chooseBtn" class="sq-button-round" onclick="choose()">确认选择</span>
                </div>
            </div>
        </form>
    </div>
    <!-- 列表显示块 -->
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null;
    $(function () {
        initForm();//初始化表单
        initGrid();//注意初始化要在initForm之后,因为在初始化grid的时候需要form参数
    });
    function searchBtnEvent() {
        var form = new liger.get("searchBar");
        var data = form.getData();
        for (name in data) {
            grid.setParm(name, data[name]);
        }
        grid.reload();
    }
    //初始化表单
    function initForm() {
        $("#searchBar").ligerForm();
    }
    // 确认选择
    function choose(){
        var selectedRows = grid.getSelectedRows();
        for(var row of selectedRows){
            row.id=null;
        }
        var callback = GET_W2Wcallback();
        callback(selectedRows)
        Remove_navTab()
    }
    //查询参数
    function getSearchParams() {
        var form = new liger.get("searchBar");
        var data = form.getData();
        return data;
    }

    //初始化列表
    function initGrid() {
        $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/finance/loan/apply/asset/initList.do',
            method: 'get',
            parms: getSearchParams(),
            columns: [
                {display: '承租人', name: 'cstNm', minWidth: 100, align: 'center', enabledSort: true},
                {display: '合同号', name: 'contNo', minWidth: 100, align: 'center', enabledSort: true},
                {display: '支付表号', name: 'paySchNo', minWidth: 100, enabledSort: true},
                {display: '所属事业部', name: 'buOrgCdNm', minWidth: 150, enabledSort: true},
                {display: '所属省公司', name: 'prOrgCdNm', minWidth: 100, align: 'center', enabledSort: true},
                {display: '所属分公司', name: 'cyOrgCdNm', minWidth: 100, align: 'center', enabledSort: true},

                {display: '客户经理', name: 'cstMgrNm', minWidth: 80, align: 'center', enabledSort: true},
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: false,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,//列表是否有选择框
            rownumbers: true//列表是否有行号
        });
        grid = liger.get("ligergrid1");
        grid.setHeight(100);
        grid.options.isSingleCheck = false;//列表是否为单选
    }




    //清空按钮事件
    function clearBtnEvent() {
        var form = new liger.get("searchBar");
        form.setData({
            cstNm: "",
            paySchNo: "",
            contNo:""
        });
    }
</script>
</body>
</html>
